Return an error code when refreshing the entry from the user's input
authorFederico Mena Quintero <federico@novell.com>
Fri, 23 Jan 2009 00:53:23 +0000 (00:53 +0000)
committerFederico Mena Quintero <federico@src.gnome.org>
Fri, 23 Jan 2009 00:53:23 +0000 (00:53 +0000)
commit2dd7cf4926bdc2edc8d27e81b86178efd091c433
tree579c42fbc369bf4e1afbaa10e28e9fd7cd279be2
parent0ff146c75cc0b0c6d3d056acf48a54ba56cd2e7b
Return an error code when refreshing the entry from the user's input
2009-01-22  Federico Mena Quintero  <federico@novell.com>

Return an error code when refreshing the entry from the user's
input.  We use this in the completion code to know when completion
can't happen due to (for example) having a non-local URI in a file
chooser that is local_only=TRUE.

Also, we start maintaining an invariant that
chooser_entry->current_folder_file != NULL implies that:

* what the user entered is valid

* we are loading that folder (chooser_entry->load_folder_cancellable != NULL)

* or we are done loading that folder, or we have a handle
to it at least (chooser_entry->current_folder != NULL)

The invariant also says that all of the above are NULL (and
chooser_entry->current_folder_file == NULL) implies that the user
typed something invalid.  This makes
_gtk_file_chooser_entry_get_current_folder() not able to return
an invalid folder.

* gtk/gtkfilechooserentry.c (RefreshStatus): New enum.
(refresh_current_folder_and_file_part): Return a RefreshStatus.
We filter out incomplete hostnames here (typing
"sftp://incompl[tab]" will error out), as well as completely
unparsable input.

Signed-off-by: Federico Mena Quintero <federico@novell.com>
svn path=/trunk/; revision=22177
ChangeLog
gtk/gtkfilechooserentry.c